package com.atao.baokede.controller;

import com.atao.baokede.pojo.MerchantMessage;
import com.atao.baokede.pojo.Result;
import com.atao.baokede.service.MerchantMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 商家邮件层
 */
@RestController
@RequestMapping("/merchantMessage")
public class MerchantMessageController {
    @Autowired
    private MerchantMessageService merchantMessageService;
    /**
     * 查看指定商家的所有邮件
     * @param merchantId 商家id
     * @return 商家邮件列表
     */
    @RequestMapping("/findAllById")
    public Result<List<MerchantMessage>> findAllById(Long merchantId){
        return Result.success(merchantMessageService.findAllById(merchantId));
    }
}
